package com.bort.system.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bort.system.utils.DateUtils;
import lombok.Data;
import java.util.Date;

@Data
@TableName("menu")
public class Menu {

    @TableId("id")
    protected Integer id;

    @TableField("name")
    protected String name;

    @TableField("path")
    protected String path;

    @TableField("icon_cls")
    protected String iconCls;

    @TableField("component")
    protected String component;

    @TableField("parent_id")
    protected Integer parentId;

    @TableField("create_time")
    protected Date createTime;

    @TableField("action_code")
    protected String actionCode;

    @TableField(exist = false)
    protected String createTimeStr;

    @TableField("level")
    protected Byte level;

    @TableField("hidden")
    protected Byte hidden;

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
        this.createTimeStr = DateUtils.toStrTime(createTime);
    }
}